package logic

import (
	"cart_srv/model/redis"
	"context"

	"cart_srv/cart"
	"cart_srv/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type CartGoodCheckLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCartGoodCheckLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CartGoodCheckLogic {
	return &CartGoodCheckLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *CartGoodCheckLogic) CartGoodCheck(in *cart.CartGoodCheckRequest) (*cart.CartGoodCheckResponse, error) {
	// todo: add your logic here and delete this line
	redis.CheckAllGood(int(in.UserId), int(in.Check))
	return &cart.CartGoodCheckResponse{Success: true}, nil
}
